// Table 9. Robustness checks: Demand shocks
use "eseefirmlevel.dta", clear

// Panel A.
local a=1
foreach var in lntotinv longinvsh size lnexpfir  exp1  crcost prod { 
local filename "table9_panelA"
xi: xtivreg2 `var' inter domfir i.indyear , fe partial(i.indyear) cluster(firmid indyear)
if `a'==1 {
outreg2 using "`filename'", word replace label dec(3) nocons keep(inter)
}
else {
outreg2 using "`filename'", word label dec(3) nocons  keep(inter)
}
local ++a
}


// Panel B.
local a=1
foreach var in lntotinv longinvsh size lnexpfir  exp1  crcost prod { 
local filename "table9_panelB"
xi: xtivreg2 `var' intershortfi shortfi i.indyear , fe partial(i.indyear) cluster(firmid indyear)
if `a'==1 {
outreg2 using "`filename'", word replace label dec(3) nocons keep(intershortfi)
}
else {
outreg2 using "`filename'", word label dec(3) nocons  keep(intershortfi)
}
local ++a
}
